{include "Public/header"}
<div class="container-fluid">
  <div class="row-fluid">
    <div class="span12">
      <div class="widget-box">
        <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
          <h5>{$title}</h5>
        </div>
        <div class="widget-content nopadding">
          <form action="" method="post" class="form-horizontal">
          {if isset($info)}
          <input type="hidden" name="id" value="{$info['id']}" />
          {/if}
            <div class="control-group">
              <label class="control-label">Production order</label>
              <div class="controls">
                <input type="text" name="order_id" class="span11" maxlength="100" value="{$info['order_id']|''}"  placeholder="please input the Product order" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Panel No</label>
              <div class="controls">
                <input type="text" name="panel_no" class="span11" value="{$info['panel_no']|''}"  placeholder="please input the Panel No" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Employee</label>
              <div class="controls">
                <select name="user_id">
                	{foreach $user_list as $k=>$v}
                		<option value="{$v['id']}" {if isset($info)&&$info['user_id']==$v['id']}selected{/if}>{$v['name']}</option>
                	{/foreach}
                </select>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">P/N</label>
              <div class="controls">
                <select name="product_id">
                	{foreach $product_list as $k=>$v}
                		<option value="{$v['id']}" {if isset($info)&&$info['product_id']==$v['id']}selected{/if}>{$v['name']}</option>
                	{/foreach}
                </select>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">P/N</label>
              <div class="controls">
                <select name="process_id">
                	{foreach $process_list as $k=>$v}
                		<option value="{$v['id']}" {if isset($info)&&$info['process_id']==$v['id']}selected{/if}>{$v['name']}</option>
                	{/foreach}
                </select>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Work start time</label>
              <div class="controls">
                <input type="text" name="start_time" class="span11" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" {if isset($info)}value="{:date('Y-m-d H:i',$info['start_time'])}"{/if} placeholder="input the work start time" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Work end time</label>
              <div class="controls">
                <input type="text" name="end_time" class="span11" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" {if isset($info)}value="{:date('Y-m-d H:i',$info['end_time'])}"{/if} placeholder="input the work end time" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Remark</label>
              <div class="controls">
                <input type="text" name="remark" class="span11" value="{$info['remark']|''}" placeholder="input the remark" />
              </div>
            </div>
            <div class="form-actions">
              <input type="submit" class="btn btn-success" value="save">
            </div>
          </form>
        </div>
      </div>
     </div>
</div></div>
{include "Public/footer"}
<script>
$(function(){
	$("form").validate({
		rules:{
			name:{
				required:true,
				rangelength:[2,100]
			},
			phone:{
				required:true,
				mobile:true
			},
			email:{
				email:true
			},
			panel_no:{
				digits:true
			}
		},
		messages:{
			name:{
				required:"required",
				rangelength:"Between 2-100 length"
			},
			phone:{
				required:"required",
				mobile:"Mobile phone format is not correct"
			},
			email:{
				email:"Mail format is not correct"
			}
		}
	});
});
</script>